#include <benchmark/benchmark.h>
#include "./src/cuckoofilter.h"
#include<iostream>
#include <assert.h>
#include <string>
#include<vector>

void insertion(long long total_items) {

  CuckooFilter<size_t, 12> filter(total_items);
  for (size_t i = 0; i < total_items; i++) {
	if (filter.Add(i) != OK) {
	}
  }
}

void vectorInsertion(long long size) {
  std::vector<int> nums;
  nums.reserve(size + 1);

  for (int i = 0; i < size; i++) {
	nums.push_back(i);
  }
}

static void vectorTest(benchmark::State &state) {
  for (auto _ : state) {
	vectorInsertion(state.range(0));
  }
}
static void Test(benchmark::State &state) {

  for (auto _ : state) {
	insertion(state.range(0));
  }
}
// Register the function as a benchmark
BENCHMARK(Test)->Arg(10000)->Arg(100000)->Arg(500000)->Arg(1000000)->Arg(10000000);
BENCHMARK(vectorTest)->Arg(10000)->Arg(100000)->Arg(500000)->Arg(1000000)->Arg(10000000);

BENCHMARK_MAIN();